package com.example.mybank.tool;


public enum ResultCode {
    SUCCESS(0, "成功"),
    UNKNOWN_EXCEPTION(1, "非自定义的错误"),
    NOT_LOGIN(2, "用户未登录"),
    PARAM_IS_INVALID(1001, "参数无效"),
    USER_NAME_NULL(2001, "用户名为空"),
    USER_NOT_EXIST(2002, "用户不存在"),
    USER_IS_EXIST(2003, "用户已存在"),
    Permission_Denied(3001, "权限不足"),
    Time_Out(3002, "超出抢购时间"),
    Buy_Max_Out(3003, "已达到购买上限"),
    No_More(3004, "已售空"),
    Schedule_Exist(4001,"预约已存在"),
    Schedule_USER_CONSISTENCY(4002,"不能删除他人预约"),
    Schedule_NOT_EXIST(4003,"预约不存在"),
    Buycount_To_Max(5001,"购买达到上限"),
    Buycount_Insert_Conflict(5002,"初筛记录插入冲突"),
    Buycount_NOT_EXIST(5003,"初筛记录不存在，请从正常接口访问"),
    Buycount_NOT_Pass(5005,"初筛未通过"),
    Buycount_NOT_Start(5006,"秒杀未开始"),
    Buycount_Is_End(5007,"秒杀已结束"),
    Buycount_Not_In_Time(5008,"秒杀不在时间"),
    Buycount_Buy_Too_Much(5009,"买得太多，剩余次数不足"),
    Value_Is_Null(6001,"value值为空，请求异常"),
    Value_Not_Correct(6002,"value值不正确"),
    Value_Not_Exist(6003,"在该网页停留太久，或未通过初筛"),
    Product_Not_Exist(7001,"产品不存在"),
    Product_Not_Enough(7002,"产品库存不足"),
    Product_Load_Fail(7003,"产品加载失败"),
    Account_Pay_Fail(8001,"付款失败，余额不足"),
        ;


    Integer code;
    String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMessage(){
        return this.message;
    }

}
